package model;

public class Teacher extends Person {
    private Course taughtCourse; // 所授课程

    public Teacher(String id, String name, String gender) {
        super(id, name, gender);
    }

    // 教师开课（关联课程）
    public void openCourse(Course course) {
        this.taughtCourse = course;
        course.setTeacher(this); // 课程关联当前教师
        System.out.println("教师[" + name + "]成功开设课程：" + course.getCourseName());
    }
}